// pages/home/job/resume/train/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    train: {
      start_year: 0,
      start_month: 0,
      end_year: 0,
      end_month: 0,
      end_today: 0,
      school_or_institution: '',
      major: '',
      certificate: '',
      awards: '',
      positions_held: '',
    },

    start: '',
    showStart: false,
    currentDate: new Date().getTime(),
    minDate: new Date(1970, 0, 1).getTime(),
    maxDate: new Date().getTime(),
  },

  sumbitTrain() {},

  openPopup(e) {
    let self = this;
    switch (e.currentTarget.dataset.name) {
      case 'start':
        self.setData({
          showStart: true
        })
        break;
    }
  },

  yearMonthConfirm(e) {

  },

  yearMonthCancel(e) {

  },

  schoolOrInstitutionBlur(e) {
    let self = this;
    self.setData({
      'train.school_or_institution': e.detail.value
    })
  },

  majorBlur(e) {
    let self = this;
    self.setData({
      'train.major': e.detail.value
    })
  },

  certificateBlur(e) {
    let self = this;
    self.setData({
      'train.certificate': e.detail.value
    })
  },

  awardsBlur(e) {
    let self = this;
    self.setData({
      'train.awards': e.detail.value
    })
  },

  positionsHeldBlur(e) {
    let self = this;
    self.setData({
      'train.positions_held': e.detail.value
    })
  }

})